define(
	[
	appBasePath + '/scripts/module.js',
	],
	function (substanceModule) {

    'use strict';

    substanceModule.controller('Demo.ListController', [
        '$scope',
        '$state',
        'gbits.websns.substance.config',
        'Demo.TodoService',
        function($scope, $state, config, todoService) {
        	$scope.list = [];        	
        	
        	function loadData() {
        		$scope.list = [
        		               {createDate: '2013-12-01 22:00:21', content: 'Test', id: '1'}
        		               ];
        		/*
        		todoService.getMyTodoList().then(function(data) {
        			if (angular.isArray(data)) {
        				$scope.list = data;
        			}
        		});
        		*/
        	}
        	
        	$scope.remove = function(id) {
        		todoService.remove(id);
        		loadData();        		
        	};
        	
        	loadData();
        }
    ]);
});